using System.Collections.Generic;

namespace Statistics.Trace
{
    public class EventTracer : IEventTracer
    {
        private readonly IEventLog _root;
        private readonly List<IEventLog> _eventLogs = new List<IEventLog>();

        public EventTracer()
        {
            _root = EventLog.Create();
        }

        public IEnumerable<IEventLog> EventLogs => _eventLogs;

        public IEventLog AddEvent(string eventName)
        {
            var result = _root.AddChild();
            result.EventName = eventName;
            _eventLogs.Add(result);
            return result;
        }
    }
}